#include "resource/texture/textureloader.h"
#include "resource/texture/pngtextureloader.h"
#include "resource/texture.h"
#include "core/File.h"

using namespace kraw;

TextureLoader* TextureLoader::create(const std::string& name)
{
	if (FilePath(name).extension() == "png") {
		return new PNGTextureLoader(name);
	}

	LOGE("TextureLoader::create : extension not supported: %s", name);
	return NULL;
}

TextureLoader::TextureLoader() :
pixels(NULL)
{
}

TextureLoader::~TextureLoader()
{
	unload();
}

bool TextureLoader::load()
{
	return true;
}

void TextureLoader::unload()
{
	if (pixels) {
		delete [] pixels;
		pixels = NULL;
	}
}
